package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tanhua.db.BlackList;
import com.tanhua.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @version 1.0
 * @author： xtr
 * @date： 2021-03-07 20:54
 */
public interface BlackListMapper extends BaseMapper<BlackList> {
    /**
     * 分页查询
     * @param userInfoPage
     * @param userId
     * @return
     */
//    @Select("select id,avatar,nickname,gender,age from tb_user_Info where id in (" +
//            " select black_user_id from tb_black_list where user_id=#{userId})")
//    IPage<UserInfo> findBlackList(IPage<UserInfo> userInfoPage,@Param("userId") Long userId);

    @Select("select id,avatar,nickname,gender,age from tb_user_Info where id in (" +
            " select black_user_id from tb_black_list where user_id=#{userId})")
    IPage<UserInfo> findBlackList(IPage<UserInfo> userInfoPage, @Param("userId") Long userId);
}
